#include "OperationSerializer.h"

int OperationSerializer::serialize(int messageType, char * message)
{
	return 0;
}

int OperationSerializer::deseralize(int messageType, const std::string & message)
{
	rapidjson::Document doc;
	doc.Parse(message.c_str());
	assert(doc.IsObject());

	operationResponse.operation_type = doc["operation_type"].GetInt();
	operationResponse.total_step = doc["total_step"].GetInt();
	operationResponse.erron_type = doc["errno_type"].GetInt();
	operationResponse.reason = doc["reason"].GetString();

	return 0;
}
